package com.spzx.channel.Contoller;

import com.spzx.channel.service.IindexService;
import com.spzx.common.core.web.controller.BaseController;
import com.spzx.common.core.web.domain.AjaxResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.ServletException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * projectName: spzx-parent
 *
 * @author: 王宝贵
 * time: 2024/10/8 17:13 周二
 * description: 客户端首页查询
 */
@Slf4j
@RestController
@RequestMapping("/index")
@Tag(name = "首页")
public class IndexController  extends BaseController {

    @Autowired
    IindexService indexService;

    /**
     * 用户端首页查询
     * @return 返回的是一个map集合
     */
    @Operation(summary = "首页数据查询")
    @GetMapping
    public AjaxResult index() throws ServletException {
        return success(indexService.getIndex());
    }
}